package com.irdstudio.efp.edoc.api.rest;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.irdstudio.efp.edoc.service.bo.ImageBizDetailVO;
import com.irdstudio.efp.edoc.service.facade.ImageBizDetailService;
import com.irdstudio.basic.framework.core.constant.ResponseData;
import com.irdstudio.basic.framework.web.controller.AbstractController;

@RestController
@RequestMapping("/api")
public class ImageBizDetailController extends AbstractController {

	@Autowired
	@Qualifier("imageBizDetailService")
	private ImageBizDetailService imageBizDetailService;

	/**
	 * 列表数据查询
	 * 
	 * @param page
	 * @param size
	 * @return
	 */
	@RequestMapping(value = "/image/biz/details", method = RequestMethod.POST)
	public @ResponseBody ResponseData<List<ImageBizDetailVO>> queryImageBizDetailAll(@RequestBody ImageBizDetailVO vo) {
		// this.executeQueryList("queryAll", imageBizDetailService, new Object[]{vo});
		List<ImageBizDetailVO> outputVo = imageBizDetailService.queryAllOwner(vo);
		return getResponseData(outputVo);

	}

	/**
	 * 根据主键查询详情
	 * 
	 * @return
	 */
	@RequestMapping(value = "/image/biz/detail/{applySeq}/{imageId}", method = RequestMethod.GET)
	public @ResponseBody ResponseData<ImageBizDetailVO> queryByPk(@PathVariable("applySeq") String applySeq,
			@PathVariable("imageId") String imageId) {
		ImageBizDetailVO inVo = new ImageBizDetailVO();
		inVo.setApplySeq(applySeq);
		inVo.setImageId(imageId);
		ImageBizDetailVO outputVo = imageBizDetailService.queryByPk(inVo);
		return getResponseData(outputVo);

	}

	/**
	 * 根据主键删除信息
	 * 
	 * @param imageBizDetail
	 * @return
	 */
	@RequestMapping(value = "/image/biz/detail", method = RequestMethod.DELETE)
	public @ResponseBody ResponseData<Integer> deleteByPk(@RequestBody ImageBizDetailVO inImageBizDetailVo) {
		int outputVo = imageBizDetailService.deleteByPk(inImageBizDetailVo);
		return getResponseData(outputVo);

	}

	/**
	 * 根据主键更新信息
	 * 
	 * @param inImageBizDetailVo
	 * @return
	 */
	@RequestMapping(value = "/image/biz/detail", method = RequestMethod.PUT)
	public @ResponseBody ResponseData<Integer> updateByPk(@RequestBody ImageBizDetailVO inImageBizDetailVo) {
		int outputVo = imageBizDetailService.updateByPk(inImageBizDetailVo);
		return getResponseData(outputVo);

	}

	/**
	 * 新增数据
	 * 
	 * @param inImageBizDetailVo
	 * @return
	 */
	@RequestMapping(value = "/image/biz/detail", method = RequestMethod.POST)
	public @ResponseBody ResponseData<Integer> insertImageBizDetail(@RequestBody ImageBizDetailVO inImageBizDetailVo) {
		int outputVo = imageBizDetailService.insertImageBizDetail(inImageBizDetailVo);
		return getResponseData(outputVo);

	}
}
